package com.xy.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

@Entity(name = "role")
@Data
public class Role {
    @Id
    private Integer id;
    private String role;
    @ManyToMany
    @JsonIgnoreProperties(value = { "roleList" })
    @JoinTable(name = "user_role_relation",joinColumns = {@JoinColumn(name="role_id")},
            inverseJoinColumns = {@JoinColumn(name = "user_id")})
    private List<User> userList;


}
